import { Check } from '@element-plus/icons-vue'
import { id } from 'element-plus/es/locales.mjs'
import Mock from 'mockjs'
export default {
    getMenu: (config) => {
        const { username, passworld } = JSON.parse(config.body)
        if (username == 'admin' && passworld == 'admin') {
            return {
                code: 200,
                data: {
                    menuList: [
                        {
                            path: "/home",
                            name: "home",
                            label: "首页",
                            icon: "HomeFilled",
                            url: "home",
                            id: 1
                        }, {
                            path: "/user",
                            name: "user",
                            label: "用户管理",
                            icon: "user",
                            url: "user",
                            id: 2
                        }, {
                            label: "其他",
                            icon: "location",
                            path: '/other',
                            children: [{
                                path: "/page1",
                                name: "page1",
                                label: "页面1",
                                icon: "setting",
                                url: "page1",
                                id: 3
                            }, {
                                path: "/page2",
                                name: "page2",
                                label: "页面2",
                                icon: "setting",
                                url: "page2",
                                id: 4
                            }]
                        }
                    ],
                    token: Mock.Random.guid(),
                    permission: ['home:add', 'home:delete'],
                    message: '获取成功'
                }
            }
        } else if (username == 'x' && passworld == 'x') {
            return {
                code: 200,
                data: {
                    menuList: [
                        {
                            path: "/home",
                            name: "home",
                            label: "首页",
                            icon: "user",
                            id: 1
                        }, {
                            path: "/user",
                            name: "user",
                            label: "用户管理",
                            icon: "user",
                            id: 2
                        }
                    ],
                    token: Mock.Random.guid(),
                    permission: ['home:add', 'home:delete'],
                    message: '获取成功'
                }
            }
        } else {
            return {
                code: -999,
                data: {
                    message: '密码错误'
                }
            }
        }
    }
}